using KernelSyntaxExample.Utils;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Orchestration;

namespace KernelSyntaxExample;

public class Example06 {
    public async Task RunAsync() {
        // Create a kernel
        var kernel = new KernelBuilder().Configure(p => {
            // Add the Azure Chat Completion service
            p.AddAzureChatCompletionService(
                ProjectEnvironment.Get(ProjectEnvironment.AoaiDeploymentName),
                ProjectEnvironment.Get(ProjectEnvironment.AoaiEndpoint),
                ProjectEnvironment.Get(ProjectEnvironment.AoaiKey));
        }).Build();

        var prompt = """
这太棒了！// Negative
这太糟糕了！// Positive
哇，那部电影太棒了！// Positive
多么可怕的节目！//
""";
        var function = kernel.CreateSemanticFunction(prompt, maxTokens: 2048,
            temperature: 0, topP: 0);

        var result = await function.InvokeAsync();

        Console.WriteLine(result);
    }
}